<!-- 成员授权编辑页面 -->
<extend name="Public/base" />

<block name="body">
<div class="main-title">
    <h2>权限管理</h2>
</div>
<div class="panel panel-default">
    <div class="panel-body">
        <div class="tab-wrap">
            <ul class="nav nav-tabs ">
                <li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
                <li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
                <li class="active"><a href="javascript:;">成员授权</a></li>
                <li class="fr">
                    <select name="group" class="form-control" >
                        <volist name="auth_group" id="vo">
                            <option value="{:U('AuthManager/user',array('group_name'=>$vo['title'],'group_id'=>$vo['id']))}" <eq name="vo['id']" value="$this_group['id']">selected</eq> >{$vo.title}</option>
                        </volist>
                    </select>
                </li>
            </ul><!-- /.panel-heading -->
         
            <div class="panel-body">
                <div class="table-responsive">		
                    <table class="table table-striped table-bordered table-hover" id="dataTables-authUser"><!-- 必须设定表格的id == -->
                        <thead>
                            <tr>
                                <th class="">UID</th>
                                <th class="">昵称</th>
                                <th class="">最后登录时间</th>
                                <th class="">最后登录IP</th>
                                <th class="">状态</th>
                                <th class="">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="_list" id="vo">
                            <tr>
                                <td>{$vo.uid} </td>
                                <td>{$vo.nickname}</td>
                                <td><span>{$vo.last_login_time|time_format}</span></td>
                                <td><span>{$vo.last_login_ip|long2ip}</span></td>
                                <td>{$vo.status_text}</td>
                                <td>
                                    <a href="{:U('AuthManager/removeFromGroup?uid='.$vo['uid'].'&group_id='.I('group_id'))}" class="ajax-get">解除授权</a>
                                </td>
                            </tr>
                            </volist>
                        </tbody>
                    </table>
                </div><!-- /.table-responsive --> 
         
                <div id="add-to-group" class=" ">
                    <form  action="{:U('addToGroup')}" method="post" enctype="application/x-www-form-urlencoded"  class="form" role="form" >
                        <input class="text  " type="text" name="uid" placeholder="请输入uid,多个用英文逗号分隔">
                        <input type="hidden" name="group_id" value="{:I('group_id')}">
                        <button type="submit" class="btn btn-default btn-default ajax-post" target-form="form">新 增</button>
                    </form>
                </div>              
            </div><!-- /.panel-body --> 
        </div><!-- /.tab-wrap --> 	
    </div>
</div>		        
</block>

<block name="script">
<script type="text/javascript" charset="utf-8">
	$('select[name=group]').change(function(){
		location.href = this.value;
	});
    //导航高亮
    $('.side-sub-menu').find('a[href="{:U('AuthManager/index')}"]').closest('li').addClass('active');
</script>
</block>
